#include <stdio.h>

int reverse_num(int);

/**
 * 题目：输入一个整数，并将其反转后输出。
*/
int main(int argc, char const *argv[])
{
    int num;
    printf("请输入一个整数：");
    scanf("%d", &num);

    int result = reverse_num(num);
    printf("反序输出：%d\n", result);

    return 0;
}

int reverse_num(int n)
{
    int sum = 0;
    int k = 0;
    while (n != 0)
    {
        k = n % 10;
        sum = sum * 10 + k;
        n/=10;
    }
    return sum;
}